Repository navigation
Audit a Kibana service and finish its guide (S-024-13) - #614
Merged
Merged
Conversation
The Kibana kind had no audit: a Kibana moved off its cluster's version, stopped, edited by hand or holding the wrong role went unseen. Audit now checks the installed version against the Elasticsearch service's declared version, the unit, kibana.yml and the heap, Kibana's own status, the two Kibana roles, the Kibana roles of each declared user, and the three keys in the keystore; a listener off loopback stays the services.bind check. Inspect reads the evidence on the Kibana server as the cloudfall account in no_log tasks and keeps names and privileges only, so no token, key, password or hash reaches an observation or a finding. A project without Kibana reads and audits as before. The guide now covers everything spec 024's Documentation section lists, ROADMAP.md and ARCHITECTURE.md name Kibana, and the spec is built with a per-criterion Verification section. Fixes #582 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mypy reads the dict literal as dict[str, Sequence[object]], which _template does not take. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
There was a problem hiding this comment.
Review: MERGE at 8abf6f4. Nothing blocking; no fixes committed.
- Rebase: already on origin/main, no conflicts;
changelog_guard.py checkexit 0 - Checks: ruff, mypy, ansible-lint,
config validate --project config/examplespass; 412 tests pass (the two new S-024-13 files, S-012 and S-024 tests, audit, observe, service evidence, S-017 compatibility, MariaDB audit, audit requirements);specs.py coverage --spec 024lists a test for every criterion,specs.py checkclean - S-024-13: each of the four cases (version off the Elasticsearch service's declared version, unit stopped,
server.hosthand-changed off loopback,supportgivencloudfall-kibana-edit) produces drift; a Kibana converged as declared audits clean against the role's realkibana.ymltemplate - Q-1: an observation without
kibanaevidence readsunknown(consistent with H-4/H-5, #436); a project without Kibana gets nokibana.check - Read-only: the inspect tasks only stat, slurp, run
kibana-keystore listwithchanged_when: false, and GET - Q-4: every task touching the password is
no_log; user metadata (the password digest) is stripped before the record - Schema: the
kibanaobject is optional and additive (Q-3) - Spec:
status: builtis honest; its Verification says no criterion has had a live run yet
Nits, not blocking:
- F-1
sdk/src/cloudfall/audit.py:1728: a 401 or 403 from Kibana reads drift ("did not answer"), notunknown(Q-1) - F-2
sdk/src/cloudfall/audit.py:1900: any failure ofkibana-keystore list, not only a missing keystore, reads drift (Q-1) - F-3
config/schemas/v1/observed-server.schema.json:1060: more than 4096 users would fail the observation's validation - F-4
sdk/src/cloudfall/audit.py:380,cloudfall_inspect/tasks/main.yml:745: #597 adds lines beside these; a small text conflict for whichever merges second (H-9)
History: H-1 to H-3, H-6, H-7 unrelated; H-4, H-5, H-8 consistent; H-9 text collision only (F-4).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloudfall auditnow checks a Kibana service (S-024-13), modelled on the Elasticsearch (S-012) and MariaDB (S-019) node checks, with the same<kind>.<check>[<service>]naming:kibana.version: the installedkibanapackage against the Elasticsearch service's declaredversion(the declaration, not a node's installed version, is the reference)kibana.unit:kibana.serviceenabled and runningkibana.configuration:/etc/kibana/kibana.ymlagainst the settings the role renders (a setting the role does not write is named, never its value) and the heap innode.optionskibana.status: the overall level ofGET /api/statusisavailablekibana.roles:cloudfall-kibana-viewandcloudfall-kibana-editas the role writes themkibana.users: each declared user of the cluster holds the Kibana role of itsaccessand no other; an undeclared user holding one is listed as unmanaged, not driftkibana.keystore: the three encryption keys, the S-011 secret requirements, by setting nameA listener off loopback (
server.hostchanged by hand and Kibana restarted) is drift of the existingservices.bindcheck; before the restart it is already drift ofkibana.configuration. Inspect gainstasks/kibana.yml, which reads the evidence as thecloudfallaccount inno_logtasks and keeps only names and privileges; the observation schema gets an optionalkibanaobject (additive). A project without Kibana audits as before.Also:
docs/kibana-service-guide.mdcompleted (licence and the paid features, SSH forward, version change, audit), the ROADMAP.md and ARCHITECTURE.md lines, and spec 024 set tobuiltwith its Verification section. This is the spec's last build issue.Plan
sdk/src/cloudfall/audit.py,config/schemas/v1/observed-server.schema.json,engine/ansible/playbooks/inspect.yml,engine/ansible/roles/cloudfall_inspect/{defaults/main.yml,meta/argument_specs.yml,tasks/main.yml,tasks/kibana.yml},sdk/tests/test_s024_13_kibana_audit.py,engine/tests/test_s024_13_kibana_inspect.py,docs/kibana-service-guide.md,docs/specs/024-kibana-service.md,ROADMAP.md,ARCHITECTURE.md,changelog.d/582-kibana-audit.mdkibana.yml, then the guide, ROADMAP and ARCHITECTURE lines, and the spec's Verificationtest_s024_13_*insdk/tests/test_s024_13_kibana_audit.pyandengine/tests/test_s024_13_kibana_inspect.py), including a clean audit of a Kibana converged as declared;specs.py coverage --spec 024lists a test for every criterionTest plan
uv run ruff check .,uv run mypy,uv run ansible-lint engine/ansible(withANSIBLE_CONFIG=engine/ansible/ansible.cfg, as CI runs it),uv run cloudfall config validate --project config/examples: passuv run pyteston the new tests and every SDK and engine test file touching audit, observation, Elasticsearch and Kibana (31 files, 529 passed), plustest_compatibility_surface.pyandtest_s017_record_kinds.py: passspecs.py checkandspecs.py coverage --spec 024: pass, every criterion has a testFixes #582
🤖 Generated with Claude Code